const div = document.createElement("div");
const span = document.createElement("span");
div.appendChild(span);
Object.assign(div.style, {
  display: "flex",
  "justify-content": "center",
  "align-items": "center",
});

Object.assign(span.style, {
  background: "rgba(65, 184, 131)",
});
/**@description 展示mask */
export function showMask(item) {
  const el = item.instance.$el;
  span.innerText = item.name;
  const style = {
    position: "fixed",
    background: "rgba(65, 184, 131, 0.35)",
    "z-index": 1000,
    ...el.getBoundingClientRect?.().toJSON(),
  };
  style.width = style.width + "px";
  style.height = style.height + "px";
  style.left = style.x + "px";
  style.right = style.y + "px";
  style.top = style.top + "px";
  style.bottom = style.bottom + "px";

  Object.assign(div.style, style);
  document.body.appendChild(div);
}
/**@description 关闭mask */
export function removeMask() {
  document.body.removeChild(div);
}
